<?php $website_url = Configure::read('Website.url'); ?>

<div id="content">
      <?php 
	if(isset($categories) and ($categories))
	{				
					$i=1;
					foreach($categories as $cat)
					{
		?>
        
        <div class="all_cat_main">
                <ul>
                    <li><b><?php echo $cat['Category']['name']; 
					//echo $this->Html->link($cat['Category']['name'], '/products/'.$cat['Category']['slug'], array('class' => 'maincatlink')); ?> </b></li> <?php
					if(isset($cat['Category']['Subcategories']) and ($cat['Category']['Subcategories'])):
                      foreach($cat['Category']['Subcategories'] as $subcat)
                                {
                                    ?>
                        <li>
                        <?php echo $html->link($subcat['Category']['name'], 
							   array('controller'=>'categories', 'action'=>'subcategories', $subcat['Category']['slug'])); ?>
                             </li>
                        <?php
                                }
						endif;		
                            ?>
                    
                  </ul>
            </div>        
 <?php				
 					if($i%3 == 0)
					{
						echo "<div class='clear'></div>";
					}
 					
 					$i++;
					}
	}
?>
    </div>
